﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using HoneyBadgersOfficePlayer.Models;

namespace HoneyBadgersOfficePlayer.AjaxPages
{
    public partial class UpdateSongRating : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int userID = Globals.UserID;
            string songID = Request.QueryString["songID"];
            string newRating = Request.QueryString["newRating"];

            SqlParameter outputParameter = new SqlParameter("@Complete", SqlDbType.Int);

            List<SqlParameter> parameterList = new List<SqlParameter>();
            parameterList.Add(new SqlParameter("@user_ID", userID));
            parameterList.Add(new SqlParameter("@Song_ID", songID));
            parameterList.Add(new SqlParameter("@Rating", newRating));

            int complete = SQLUtilities.RunStoredProcedure("Update_User_Song_Rating", parameterList, outputParameter);
 
        }
    }
}